import { zcc } from "../../../../utils/util";

// pages/mine/subpages/settings/settings.ts
Page({
    //
    menuItemOnClick() {

    },
    /**
     * 页面的初始数据
     */
    data: {
        account: '',
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad() {
        this.setData({
            account: this.options.account || ''
        })
    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady() {

    },
    goWebpage(id: string, title: string) {
        const weburl = "https://admin2.bcyhl.com/docpage?id=" + id;
       zcc.goWebpage(weburl, title)
    },
    handleNavigate(e: any) {
        const type = e.currentTarget.dataset.type;
        switch (type) {
            case 'logout':
                // 注销账号
                wx.navigateTo({
                    url: '/pages/mine/subpages/releaseaccount/releaseaccount'
                })
                break;
            case 'agreement':
                // 用户协议
                //https://www.bczcc.com/userprotocol
                this.goWebpage('17', '用户协议')
                break;
            case 'privacy':
                // 隐私政策
                {
                    //https://www.bczcc.com/pravicyprotocol
                    this.goWebpage('18', '隐私政策')
                }
                break;
        }
    }
})